package com.crossriver.crgis.mail.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class TestHash {
	
	public static void main(String[] aa){
		
		MessageDigest md = null;
		try {
			md = MessageDigest.getInstance("SHA-512");
			
			String strToHash = "CRGIA-2012-012331-2012.10.24.10.5739871012000000http://www.crgia.crossriverstate.gov.ng/group/crgia/payments?p_auth=o7LCkBQc&echo=Payment&p_p_id=Payments_WAR_CRGISTransactionCofOportlet&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_count=1&_Payments_WAR_CRGISTransactionCofOportlet_javax.portlet.action=processDirectPayResponse&transactionNo=7ac3c1fb-60a8-45f8-9625-48b6b4b4edd9F64AC041AE5041BDD2B1A88CF895C847825F183DF8D3E32D1C4C4C351C1A26FD5F22448FD59FE3B56F9138D1C050DBFCC58E714F39335E5AF9D8C06CA9B11B74";
			md.update(strToHash.getBytes());
			 
	        byte byteData[] = md.digest();
	 
	        //convert the byte to hex format method 1
	        StringBuffer sb = new StringBuffer();
	        for (int i = 0; i < byteData.length; i++) {
	         sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
	        }
	        
	        System.out.println(sb.toString().toUpperCase());
	        
			
		} catch (NoSuchAlgorithmException e) {
			
		}
	}

}
